package com.kawa.kemanage.service.impl;

import com.kawa.kemanage.mapper.NewsFavoritesMapper;
import com.kawa.kemanage.service.NewsFavoritesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class NewsFavoritesServiceImpl implements NewsFavoritesService {
    @Autowired
    private NewsFavoritesMapper newsFavoritesMapper;

    //取消收藏
    @Override
    public boolean delectfavorites(Integer favorite_id) {
        return newsFavoritesMapper.delectFavorites(favorite_id)>0;
    }

    //* 根据新闻id查看收藏数
    @Override
    public long getFavoritesCount(Integer content_id) {
        return newsFavoritesMapper.getFavoritesCount(content_id);
    }
}
